import java.io.*;

public class BufferWriterDemo11 {
    public static void main(String[] args) throws IOException {


        // 缓冲输出流
        FileWriter fileWriter = new FileWriter("F:\\IdeaProjects\\MyJava230203\\day27\\dir\\3.txt");
        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);

        bufferedWriter.write(97);
        bufferedWriter.write(65);
        bufferedWriter.write(48);
        bufferedWriter.flush();
        bufferedWriter.close();// 只需要关闭缓冲流即可


        // 缓冲输入流
        FileReader fileReader = new FileReader("F:\\IdeaProjects\\MyJava230203\\day27\\dir\\2.txt");
        BufferedReader bufferedReader = new BufferedReader(fileReader);

        String content;
        while ((content=bufferedReader.readLine()) != null){
            System.out.println(content);
        }

        bufferedReader.close();


    }
}
